package ia1011.zanzibar.rules;

import java.util.*;

/**
 * The class represents a regular expression over feature structures.
 * 
 * @author Alessandro Perrino (creator)
 * @author <br> Bastianelli E. emanuele.bastianelli@gmail.com (modifier)
 * @author <br> Caponi E. emiliano.caponi@gmail.com (modifier)
 * @author <br> Castellucci G. castellucci.giuseppe@gmail.com (modifier)
 * @author <br> Rossi A. berardino.viola@gmail.com (modifier)
 *  
 */

public class FSRegEx extends RegExElem {
	
	// The sequence of elements forming the regular expression
	ArrayList<RegExElem> elements; 
	
	/**
	 *  create new list of regular expression
	 */
	public FSRegEx() {
		elements = new ArrayList<RegExElem>();
	}
	
	/**
	 * Add a regular expression element  to the regular expression
	 * @param regexElem regular expression element  
	 */
	public void addElement(RegExElem regexElem) {
		elements.add(regexElem);
	}
	
	/**
	 * 
	 * @return the list of all elements that form the regular expression  
	 */
	public ArrayList<RegExElem> getElements() {
		return elements;
	}
	
	/**
	 * Prints a simple string representation of the regular expression elements. 
	 */
	public void display() {
		for (RegExElem current : elements) {
			current.display();
		}		
	}
}
